#pragma once

#include <memory>
#include "Render/Material/RenderMaterialType.h"

class CPreRenderShader;
class CPreRenderTexture2D;
class CPreRenderTextureCube;

struct SPreRenderPipeline
{
    std::shared_ptr<CPreRenderShader> VertexShader;
    std::shared_ptr<CPreRenderShader> FragmentShader;
    bool bDoubleSided=false;
    ERenderMaterialType Type =  ERenderMaterialType::Unknow; 

    uint64_t GetHashCode() const;

    bool operator==(const SPreRenderPipeline& Other) const
    {
        return VertexShader==Other.VertexShader
            &&FragmentShader==Other.FragmentShader
            &&bDoubleSided==Other.bDoubleSided
            &&Type==Other.Type;
    }

};

struct SPreRenderMaterialParameters
{
    TVector<float> Parameters;
    TVector<std::shared_ptr<CPreRenderTexture2D>> Texture2Ds;
    TVector<std::shared_ptr<CPreRenderTextureCube>> TextureCubes;

    uint64_t GetHashCode() const;

    bool operator==(const SPreRenderMaterialParameters& Other) const
    {
        return Parameters==Other.Parameters
            &&Texture2Ds==Other.Texture2Ds
            &&TextureCubes==Other.TextureCubes;
    }
};

class CPreRenderMaterial
{
public:
    SPreRenderMaterialParameters Parameters;
    SPreRenderPipeline Pipeline;
};